<div ng-controller="DistributorCtrl" ng-init="orderAction()">
    <ul class="sui-breadcrumb">
        <li>{{'Order'| translate}}</li>
        <li>{{'List'|translate}}</li>
        <span class="sui-form sui-form pull-right">

            <input type="text" placeholder="{{'Orderid'|translate}}" ng-model="order_id">
            <input placeholder="{{'start time'|translate}}" datetimepicker ng-model="start_time">
            <input placeholder="{{'end time'|translate}}" datetimepicker min-date="{{start_time}}" ng-model="end_time">
            <button class="sui-btn btn-primary" ng-click="getOrderList(1)">{{'search'|translate}}</button>
            <wxinfo ng-model="agentInfo" is-url="1" stye="1"></wxinfo>
            <chose-agent member-check="callbackAgent(agentInfo)"></chose-agent>
            <export-data startcreated="start_time" endcreated="end_time" orderid="order_id" user_id="agentInfo" chosedstatus="chosedStatus"
                type="2"> </export-data>
        </span>
    </ul>
    <fxdetail-tab ng-model="chosedStatus" click-tab="getOrderList(1)"></fxdetail-tab>
    <table class="sui-table table-bordered">
        <thead>
            <tr>
                <th>{{'订单编号'|translate}}</th>
                <th>{{'代理商信息'|translate}}</th>
                <th>{{'代理等级'|translate}}</th>
                <th>{{'买家信息'|translate}}</th>
                <th>{{'产品线'|translate}}</th>
                <th>{{'订单时间'|translate}}</th>
                <th>{{'订单商品'|translate}}</th>
                <th>{{'数量'|translate}}</th>
                <th>{{'应付'|translate}}</th>
                <th>{{'实付'|translate}}</th>
                <th>{{'返点比例'|translate}}</th>
                <th>{{'返点金额'|translate}}</th>
                <th>{{'状态'|translate}}</th>
                <!-- <th>操作</th> -->
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="list in detail_list" ng-show="detail_list.length>0">
                <td>
                    {{list.order_id}}
                    <br />
                    <order-dd-status ng-model="list.order_id"></order-dd-status>
                </td>

                <td>
                    <wxinfo ng-model="list.user_id" stye="1"></wxinfo><br>
                    <span class="sui-label label-info">{{list.order == 1 ? '上级代理' : list.order == 2?'上上级代理':''}}</span>
                </td>
                <td>
                    <fxgrade-list ng-model="list.grade_id" stype="1"></fxgrade-list>
                </td>
                <td>
                    <wxinfo ng-model="list.member_id" stye="1"></wxinfo>
                </td>
                <td>
                    <fxproduct-list ng-model="list.product_id" stype="1"></fxproduct-list>
                </td>
                <td>{{list.order_time | ddtt}}</td>
                <td>
                    <item-name item-id="list.item_id" sku-id="list.sku_id" type="list.type"></item-name>
                </td>
                <td>{{list.quantity}}</td>
                <td><span ng-if="list.order == 0">{{list.total_fee}}</span></td>
                <td><span ng-if="list.order == 0">{{list.payment}}</span></td>
                <td><span style="color:#f00">{{list.order > 0? "一级佣金乘以":""}}</span> {{list.proportion}}%</td>
                <td>{{list.return_money}}</td>
                <td>
                    <span ng-show="list.status ==1" class="sui-text-info">
                        <a href="#/distributor/checkorder?detail_id={{list.detail_id}}">未审核</a>
                    </span>
                    <span ng-show="list.status ==2" class="sui-text-success">
                        <a href="#/distributor/checkorder?detail_id={{list.detail_id}}">待结算</a>
                        <button class="sui-btn btn-primary hide" ng-click="payDirectly(list.detail_id,list.order_id)">直接付钱</button>
                    </span>
                    <span ng-show="list.status ==3" class="sui-text-danger">
                        <a href="#/distributor/checkorder?detail_id={{list.detail_id}}">已结算</a>
                    </span>
                </td>
            </tr>
        </tbody>
    </table>
    <!-- 分页start -->
    <pager page-no="{{pageNo}}" page-size="pageSize" total="detail_count" get-data="getOrderList(pageNo)"></pager>
    <!-- 分页end -->
</div>